import os, sys, poser

os.chdir( os.path.dirname(poser.AppLocation()) )
if float(poser.Version()) >= 7:
    sys.path.append(os.path.join("Runtime","Python","Poseworks","Particles3","data","24"))
else:
    sys.path.append(os.path.join("Runtime","Python","Poseworks","Particles3","data","22"))

import prt3Node
from prt3Constants import *

figure = poser.Scene().CurrentFigure()
actor = figure.ParentActor()
parm = actor.Parameter(PARM_TYPE)
if parm and parm.Value() == GROUP_TYPE:
    prt3Node.simulate(figure)
else:
    poser.DialogSimple.MessageBox("No particle figure selected.")

pass
